﻿package com.vigmonk.utils{
	import flash.display.DisplayObject;		import flash.display.LoaderInfo;	import flash.system.Capabilities;		
	/**	 * 	 * GetPlayerType.as	 * @author VIGMONK	 * 	 */	 	/**	 * 	 * import com.vigmonk.utils.GetPlayerType;	 * 	 * var plauerType:String = GetPlayerType.init(this);	 * trace(playerType);	 * 	 */
	public class GetPlayerType
	{
		public function GetPlayerType():void{}
		public static function init(_dispObj:DisplayObject):String
		{
			var type:String = Capabilities.playerType;
			var url:String = LoaderInfo(_dispObj.root.loaderInfo).url;
			
			if(type=='StandAlone' || type=='External') {
				// 플레이어 
				return 'PLAYER';
			}else {
				// 브라우저
				if(url.substr(0, 4)=='http') {
					// 온라인
					return 'BROWSER_ON';
				}else {
					// 오프라인
					return 'BROWSER_OFF';
				}				
			}
		}
	}
}